<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>04具名插槽</title>
</head>
<body>
  <div id="app">
    <h1>vue的例子</h1>
    <p>{{msg}}</p>
    <Demo>
        <template v-slot:header>
            <h1>提示</h1>
        </template>
        <template>
            <h3>默认插槽</h3>
        </template>
        <template v-slot:footer>
            <button>提交</button>
        </template>
    </Demo>
  </div>
  <script src="./js/vue.js"></script>
  <script>
    Vue.component("Demo",{
        template:`
            <div>
                <p>这是子组件Demo</p>
                <slot name="header"></slot>
                <slot></slot>
                <slot name="footer"></slot>
            </div>
        `,
    })
    Vue.config.productionTip = false; // 关闭生产提示
    const vm = new Vue({
      el: '#app',
      data: {
        msg: 'hello'
      }
    })
  </script>
</body>
</html>